#! /bin/sh
#
# Copyright (C) 2000-2022 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#
# bacula       This shell script takes care of starting and stopping
#	       the bacula File daemon.
#
# chkconfig: 2345 90 9
# description: The Leading Open Source Backup Solution.
#
#  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
#

RETVAL=0
case "$1" in
    start)
       echo "Starting the Bacula File daemon: "
       @sbindir@/bacula-fd $2 -c @sysconfdir@/bacula-fd.conf
       RETVAL=$?
       echo
       [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-fd
       ;;
    stop)
       echo "Stopping the Bacula File daemon: "
#	killproc @sbindir@/bacula-fd
       RETVAL=$?
       echo
       [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-fd
       ;;
    restart)
       $0 stop
       sleep 5
       $0 start
       RETVAL=$?
       ;;
    *)
       echo "Usage: $0 {start|stop|restart}"
       exit 1
       ;;
esac
exit $RETVAL
